import QtQuick 2.12
import QtQuick.Controls 2.5
import CommonAPI 1.0

/** 主界面顶部菜单组建
*/

Item {
    signal openCamera(string device_name)

    signal insertWord()

    Rectangle {
        anchors.fill: parent
        Row{
            anchors.fill: parent
            spacing:6
            ComboBox{
                height: parent.height
                id: camera_list
                model: CommonAPI.getCameralist();
            }

            Button {
                id: bt_open_camera
                text: "Open"
                height: parent.height
                onClicked: {
                    if(camera_list.currentText != ""){
                        openCamera(camera_list.currentText)
                    }
                }
            }

            Button {
                text: "插入文字"
                height: parent.height
                onClicked: {
                    insertWord()
                }
            }
        }

    }
}
